import {
    WeaPopoverHrm,
    WeaLocaleProvider,
    WeaTools
} from 'ecCom';
import {
    WeaLogView
} from 'comsMobx';
import loadjs from 'loadjs';
const WeaLogViewComp = WeaLogView.Component;
const {
    LogStore
} = WeaLogView;

class Home extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            key: new Date().getTime(),
            visible: false,
            logStore: new LogStore(),
            logType: '4',
            logSmallType: '',
        }
        window.setLogViewProps = this.setLogViewProps;
    }


    setLogViewProps = (props) => {
        this.setState({
            key: new Date().getTime(),
            targetId: '',
            visible: true,
            logType: '4',
            logStore: new LogStore(),
            ...props
        });
    }
    onCancel = () => {
        this.setState({
            visible: false
        })
    }
    render() {
        return (
            <div style={{height:"100%"}}>
                <WeaPopoverHrm />
                <WeaLogViewComp {...this.state} onCancel={this.onCancel}/>
                <WeaLocaleProvider>
                {this.props.children}
                </WeaLocaleProvider>
            </div>
        )
    }
}

export default Home